/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package easyrgb.frame;

import java.awt.Component;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.AbstractCellEditor;
import javax.swing.JFileChooser;
import javax.swing.JTable;
import javax.swing.table.TableCellEditor;

/**
 *
 * @author tandn
 */
public class CStringEditor extends AbstractCellEditor
        implements TableCellEditor, MouseListener
{
    private JFileChooser m_fileBrowse;
    private String m_strPath = "";

    @Override
    public Object getCellEditorValue()
    {
        return m_strPath;
    }

    @Override
    public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
    {
        m_strPath = (String) value;
        return null;
    }

    @Override
    public void mouseClicked(MouseEvent e)
    {
        m_fileBrowse = new JFileChooser();
        //Make the renderer reappear.
        fireEditingStopped();
    }

    @Override
    public void mousePressed(MouseEvent e)
    {
    }

    @Override
    public void mouseReleased(MouseEvent e)
    {
    }

    @Override
    public void mouseEntered(MouseEvent e)
    {
    }

    @Override
    public void mouseExited(MouseEvent e)
    {
    }
}

